package models

import "time"

// Document 文档表
type Document struct {
	ID           uint      `gorm:"primaryKey;autoIncrement"`
	Title        string    `gorm:"type:varchar(255);not null"`
	Process      int       `gorm:"not null;default:0"`
	Step         int       `gorm:"not null;default:0;check:step >= 0 AND step <= 3;comment:'当前校对的状态 0 未开始 1 2 3'"`
	IsLock       bool      `gorm:"not null;default:false"`
	LockedUserID *uint     `gorm:"index"`
	Origin       string    `gorm:"type:text"`
	FirstCheck   string    `gorm:"type:text"`
	SecondCheck  string    `gorm:"type:text"`
	ThirdCheck   string    `gorm:"type:text"`
	CreatedAt    time.Time `gorm:"not null;default:CURRENT_TIMESTAMP"`
	UpdatedAt    time.Time `gorm:"not null;default:CURRENT_TIMESTAMP"`

	LockedUser *User `gorm:"foreignKey:LockedUserID"`
}
